package com.ying.po.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("订单信息")
@Entity
@Table(name = "t_order")
@DynamicInsert
@DynamicUpdate
public class Order implements Serializable {

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty(value = "箱数")
    @Column(name = "count")
    private Integer count;

    @ApiModelProperty(value = "重量")
    @Column(name = "weight")
    private Float weight;

    @ApiModelProperty(value = "发货人ID")
    @Column(name = "seller_id")
    private Integer sellerId;

    @ApiModelProperty(value = "收货人ID")
    @Column(name = "buyer_id")
    private Integer buyerId;

    @ApiModelProperty(value = "每箱价格")
    @Column(name = "price")
    private BigDecimal price;

    @ApiModelProperty(value = "包装ID")
    @Column(name = "wrap_id")
    private Integer wrapId;

    @ApiModelProperty(value = "快递ID")
    @Column(name = "express_id")
    private Integer expressId;

    @ApiModelProperty(value = "橙子ID")
    @Column(name = "orange_id")
    private Integer orangeId;

    @ApiModelProperty(value = "订单创建时间")
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-DD", timezone = "Asia/Shanghai")
    private Date createTime;

    @ApiModelProperty(value = "是否删除")
    @Column(name = "is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "订单是否完成")
    @Column(name = "is_done")
    private Integer isDone;

    @ApiModelProperty(value = "系统用户ID")
    @Column(name = "user_id")
    private Integer userId;

    @ApiModelProperty(value = "订单备注")
    @Column(name = "remark")
    private String remark;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDone() {
        return isDone;
    }

    public void setIsDone(Integer isDone) {
        this.isDone = isDone;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Float getWeight() {
        return weight;
    }

    public void setWeight(Float weight) {
        this.weight = weight;
    }

    public Integer getSellerId() {
        return sellerId;
    }

    public void setSellerId(Integer sellerId) {
        this.sellerId = sellerId;
    }

    public Integer getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(Integer buyerId) {
        this.buyerId = buyerId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getWrapId() {
        return wrapId;
    }

    public void setWrapId(Integer wrapId) {
        this.wrapId = wrapId;
    }

    public Integer getExpressId() {
        return expressId;
    }

    public void setExpressId(Integer expressId) {
        this.expressId = expressId;
    }

    public Integer getOrangeId() {
        return orangeId;
    }

    public void setOrangeId(Integer orangeId) {
        this.orangeId = orangeId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", count=" + count +
                ", weight=" + weight +
                ", sellerId=" + sellerId +
                ", buyerId=" + buyerId +
                ", price=" + price +
                ", wrapId=" + wrapId +
                ", expressId=" + expressId +
                ", orangeId=" + orangeId +
                ", createTime=" + createTime +
                ", isDelete=" + isDelete +
                ", isDone=" + isDone +
                ", userId=" + userId +
                ", remark='" + remark + '\'' +
                '}';
    }
}
